<!-- 取件信息 -->

<template>
	<Card>
		<template #head>
			取件信息
		</template>
		<template #body>
			<view class="u-flex">
				<view class="u-flex-4">
					<CellDetail label="取件科室" :value="pickUpInfo.deptIdToName"></CellDetail>
					<CellDetail label="取件地址" :value="pickUpInfo.deptPlace"></CellDetail>
					<CellDetail label="联系人" :value="Contact"></CellDetail>
					<CellDetail label="预约取件" text-color="#F56C6C" :value="pickUpInfo.pickUpTime"></CellDetail>
				</view>
				<template v-if="pickUpInfo.phone">

					<view class="u-flex-1 u-text-right">
						<HIcon icon="phone-fill" :block="false" type="fill" size="medium" @click="onCallPhone"></HIcon>
					</view>
				</template>
			</view>
		</template>
	</Card>
</template>
<script>
	import Card from '@/components/card/components/cardDetail.vue'
	import HIcon from '@/components/button/circleIcon.vue'
	import CellDetail from '../../../../cell/itemDetail.vue'
	export default {
		props: {
			pickUpInfo: {
				type: Object,
				default: () => {
					return {}
				}
			}
		},
		components: {
			Card,
			HIcon,
			CellDetail
		},
		computed: {
			Contact() {
				let {
					deptUserIdToName,
					phone
				} = this.pickUpInfo
				return `${deptUserIdToName || '-'} ${phone || ''}`
			}
		},

		onCallPhone() {
			wx.makePhoneCall({
				phoneNumber: this.pickUpInfo.phone
			})

		}
	}
</script>

<style lang="scss" scoped>

</style>
